package com.ziven.common.widget.setting;

import android.view.ViewGroup;

import androidx.annotation.NonNull;

import com.ziven.easygo.ui.AbstractTypeAdapter;

/**
 * @author Ziven
 */
public class PreferenceAdapter extends AbstractTypeAdapter<BasePreferenceItem, PreferenceHolder> {

    private final PreferenceItemsFactory itemsFactory;

    public PreferenceAdapter(@NonNull PreferenceItemsFactory factory) {
        itemsFactory = factory;
    }

    @NonNull
    @Override
    public PreferenceHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        return new PreferenceHolder(parent, viewType, itemsFactory);
    }
}
